package com.guoxin.singleton;

/**
 * @author guoxin
 * @date 2019/8/15
 */
public enum EnumInstance {
    /**/
    INSTANCE;

    public void show() {
        System.out.println("hello world");
    }
}


class TestEnumInstance {

    public static void main(String[] args) {
        EnumInstance instance = EnumInstance.INSTANCE;
        EnumInstance instance2 = EnumInstance.INSTANCE;
        System.out.println(instance == instance2);
        System.out.println(instance.hashCode());
        System.out.println(instance2.hashCode());
        instance.show();
    }
}